var num = 0;
var lineHeight = 0;

function clickBtn() {
    if (num % 10 == 0) {
        if (lineHeight % 5 == 0) {
            console.clear();
            lineHeight = 0;
        }
        console.log("正在检测弹出框..." + new Date());
        lineHeight++;
    }
    let btn = document.querySelector('.layui-layer-btn0');
    if (btn) {
        try {
            console.log('弹出对话框，已点击\"确定\"按钮');
            num = 0;
            btn.click();
        } catch (error) {
            console.error('点击按钮时发生错误:', error);
        }
    }
    num++;
}

setInterval(clickBtn, 6000);